import request from '@/utils/request'

// 查询成都大学部门列表
export function listDept(query) {
  return request({
    url: '/cdutDept/dept/list',
    method: 'get',
    params: query
  })
}
//查询上级部门
export function parentDepartment(query){
  return request({
    url: '/cdutDept/dept/parent',
    method: 'get',
    params: query
  })
}
//查询下级部门
export function childrenDepartment(query){
  return request({
    url: '/cdutDept/dept/children',
    method: 'get',
    params: query
  })
}


// 查询成都大学部门详细
export function getDept(deptId) {
  return request({
    url: '/cdutDept/dept/' + deptId,
    method: 'get'
  })
}

// 新增成都大学部门
export function addDept(data) {
  return request({
    url: '/cdutDept/dept',
    method: 'post',
    data: data
  })
}

// 修改成都大学部门
export function updateDept(data) {
  return request({
    url: '/cdutDept/dept',
    method: 'put',
    data: data
  })
}

// 删除成都大学部门
export function delDept(deptId) {
  return request({
    url: '/cdutDept/dept/' + deptId,
    method: 'delete'
  })
}
